import Vue from 'vue';
import Router from 'vue-router'

//***********h5页面展示路由*************
const main = () =>
	import('@/h5-views/main')

const h5ArticleDetail = () => 
	import('@/h5-views/h5/h5-article-detail')

export const h5Router = [
	{
		path: '/',
		meta: {
			title: 'h5页面',
		},
		name: 'Main',
		component: main,
	},
	{
		path: '/h5-article-detail/:id',
		meta: {
			title: '文章展示',
		},
		name: 'H5ArticleDetail',
		component: h5ArticleDetail,
	}
]
// 路由输出
const routers = [
	...h5Router
];

Vue.use(Router)
export const router = new Router({
	routes: routers
});
//路由拦截

router.beforeEach((to, from, next) => {
//if (to.path !== '/login' && !localStorage.token) {
//  return next({
//  	name: 'login'
//  })
//}
   // console.log(to)
   // console.log(from)
   next()
})
